home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5496 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  38 lines

  1. Newsgroups: comp.lang.c++
  2. Path: cannon.ecf!ber
  3. From: ber@ecf.toronto.edu (BER  PHILIP)
  4. Subject: Help!: Accessing classes declared externally
  5. X-Nntp-Posting-Host: spark14.ecf
  6. Message-ID: <DMA4pp.E5v@ecf.toronto.edu>
  7. Sender: news@ecf.toronto.edu (News Administrator)
  8. Organization: University of Toronto, Engineering Computing Facility
  9. Date: Mon, 5 Feb 1996 01:41:49 GMT
  10.  
  11.  
  12. I am trying to compile a module into a library in Watcom C/C++ 10.5 and I 
  13. have encountered the following problem: I have classes within the library 
  14. which I would like to access in other modules. I am unable, however, to use 
  15. the extern directive in the module to access the class:
  16.  
  17. i.e.
  18.  
  19. extern class foobar;
  20.  
  21. Similar to something like 'extern void foobar();', I would expect the 
  22. compiler to use this as a declaration of a class which lies outside of 
  23. the module.
  24.  
  25. The compiler will accept this, however, attempting to use foobar in any 
  26. way, shape or form, causes the whole program to die horribly. Can anyone 
  27. tell me what I am doing wrong? Thanks for any help.
  28.  
  29.   __       __
  30.  /_/      /_/
  31. / hilip  /_/ er
  32.  
  33. Computer Engineering,
  34. University of Toronto.
  35. ber@ecf.toronto.edu
  36.  
  37.  
  38.